﻿using System;
using System.IO;

namespace NBuild.Fx
{
    public sealed class BuildEnvironment
    {
        private readonly string _binPath;

        public BuildEnvironment()
        {
            string firstArgs = Environment.GetCommandLineArgs()[0];
            _binPath = Path.GetFullPath(firstArgs);
        }

        public DirectoryInfo BinDirectory
        {
            get { return new DirectoryInfo(Path.GetDirectoryName(_binPath)); }
        }

        public string BinFileName
        {
            get { return Path.GetFileName(_binPath); }
        }

        public string BinName
        {
            get { return Path.GetFileNameWithoutExtension(_binPath); }
        }

        public string BinPath
        {
            get { return _binPath; }
        }

        public DirectoryInfo CurrentDirectory
        {
            get { return new DirectoryInfo(Environment.CurrentDirectory); }
        }

        public Version Version
        {
            get { return new Version(0, 1); }
        }
    }
}
